(1) Field of the Invention
The present invention relates to the field of providing operating system services for use by audio and video applications. More specifically, the present invention is a method and apparatus for mixing and splitting multiple independent audio data streams in kernel space, i.e. part of an operating system that performs basic functions such as allocating hardware resources.
(2) Art Related to the Invention
Audio and video applications running on a computer (e.g. a workstation, a personal computer xe2x80x9cPCxe2x80x9d, mainframe, etc.) often require mixing and splitting of data (e.g., audio and/or video) as the data is being input or output to some type of network device such as an Integrated Services Digital Network (ISDN) device. An ISDN device is a digital phone network defining B-channels carrying up to 64 Kbps.
Many mixer and splitter devices are implemented in firmware or hardware on a card for a PC. A mixer may mix outputs from two specific audio peripheral devices and mix inputs on a microphone or some other set of peripheral devices. There are also software based mixers and splitters which are available in Apple Macintosh computers, IBM PC""s and IBM PC compatibles, Sun Microsystem, Inc.""s workstations and in other UNIX based machines. More particularly, there is the Audio File (AF) system from Digital Equipment Corporation (DEC) of Maynard, Massachusetts, and Network Audio System (NAS) from Network Computing Devices (NCD), Inc. of Mountain View, California, which are both audio servers that have mixing capabilities.
FIG. 1 illustrates an exemplary embodiment of computer employing a conventional mixer/splitter device. Computer 101 includes a storage device 103, processor (CPU) 105 and audio device 110 coupled through bus 107. Audio applications 100, 102 and 104 are coupled to a software-based mixer and splitter, audio server 106. Audio server 106 is contained in user space 108 which the area in the storage device used for execution of user programs, and is coupled to audio device 110. Audio server 106 takes incoming audio data streams from one or more audio applications 100, 102 and 104, mixes them together and transmits them to audio device 110. Audio server 106 also takes an audio data stream coming from the audio device 110, clones the data and transmits the data to one or more audio applications 100, 102 and 104 requesting the data.
As illustrated in FIG. 1, software-based mixing and splitting functions in the prior art are performed in user space 108 and audio device 106 can only handle one audio application at a time. Consequently, an audio application has to provide its own mixing and splitting functions or depend on audio servers such as NAS and AF to provide that functionality via a proprietary API (Application Programming Interface). Further, an audio server retains exclusive use of the audio device, forcing audio applications to use a given audio server or not have access to the audio device at all. This is a poor programming practice since it cannot be assumed that a given audio server will be available on another machine.
It is more desirable to have the capability to process multiple simultaneous audio streams in kernel space rather than in user space since this allows multiple audio applications to access an audio device and allows backward compatibility with existing audio applications because, among other things, the current Application Program Interface (API) does not change. The ability to write to an existing API allows the splitting and mixing operations to be transparent regardless of the audio applications from which audio data is being received and transmitted for the mixing and splitting operations.
Therefore it is desirable to have a method and an apparatus for processing multiple simultaneous audio streams in kernel space.
The present invention provides for processing of multiple simultaneous audio streams. Additionally, the present invention provides for the mixing and splitting capabilities in kernel space rather than in user space of a system""s software environment. This allows for some backward compatibility with old applications running audio and allows for writing to an existing interface. The ability to write to an existing interface allows the splitting and mixing operations to be transparent regardless of the audio applications from which audio data is being received and transmitted for the splitting and mixing operations.
In one embodiment of the invention, a computer has a central processing unit (CPU) coupled to a storage device. The storage device has several audio applications contained in user space. An audio server (mixer and/or splitter) and an audio device driver are in kernel space. The present invention also has a data flow checker and adjuster for checking the flow of data into data queues and a setup application for connecting the audio server and the audio device driver. The data flow checker and adjuster adjusts the flow of data by sending a message upstream or downstream instructing the upstream or downstream processes/devices to send more data or stop sending data depending on how full the data queues are.